import cv2
cap = cv2.VideoCapture(0)  # 0自己的摄像头，1、2是外部摄像头
while cap.isOpened():
    retval, frame = cap.read()
    if not retval:
        print("没有视频输入")
    cv2.imshow('video',frame)
    saveFile = "./Mediapipe/1.png"

    key = cv2.waitKey(60)
    if key == ord('e'):
        cv2.imwrite(saveFile, frame)
        break  #跳出循环
cap.release()
cv2.destroyAllWindows()
